#include "../../../src/thread/Mutex.h"
#include "SessionMgr.h"
#include <utility>

namespace server
{
	using namespace std;
	using namespace LibTools;

	void SessionMgr::DeleteSession(Session* s)
	{
		CLockGurad lk(&m_mutex);
		m_sockets.erase(s);
	}

	void SessionMgr::Insert(const SharedPtr<Session>& s)
	{
		CLockGurad lk(&m_mutex);
		SharedPtr<Session> tmp(s);
		m_sockets.insert(make_pair(tmp.Get(), tmp));
	}
}